[Django] Automatically Update Field when a Different Field is Changed

Posted by Gordon on Stack Overflow See other posts from Stack Overflow or by Gordon
Published on 2010-03-26T08:02:54Z Indexed on 2010/03/26 8:13 UTC
Read the original article Hit count: 510

I have a model with a bunch of different fields like first_name, last_name, etc. I also have fields first_name_ud, last_name_ud, etc. that correspond to the last updated date for the related fields (i.e. when first_name is modified, then first_name_ud is set to the current date).

Is there a way to make this happen automatically or do I need to check what fields have changed each time I save an object and then update the related "_ud" fields.

Thanks a lot!

© Stack Overflow or respective owner

Related posts about python

Related posts about django